/**
 * 
 */
package hichecker.ui.components.custom_table.column_class;


/**
 *
 */
public class Points{

	public static boolean isPoints(String input) {
		try {
			parsePoints(input);
			return true;
		} catch (NumberFormatException e) {
			return false;	
		}
	}
	
	public static float parsePoints(String input) {
		input = input.trim().replace(",", ".");
		if (input.equals("")) {
			return -1;
		}
		float out = Math.round(Float.parseFloat(input) * 10) / 10f;
		return out < 0 ? -1 : out;
	}

}